<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>
    <script>
        var str = new String("hi nihaoya");
        var num = typeof(str);
        if(num.length==6){
            str.aaa = "hi nihaoya";
        }else{
            str.aaa = "hi";
        }
        console.log(str.aaa);

        var str1 = "hello world";
        console.log(str1.indexOf("o",5));

        console.log(Math.random());//生成0-1的随机数
        console.log(parseInt(Math.random()*100));//这种情况取不到100
        console.log(Math.floor(Math.random()*101));
        console.log(Math.ceil(Math.random()*101)-1);
        console.log(parseInt(Math.random()*91)+10);//0-90的随机数
        var str2 ;
        if(Math.random()>0.5){
            str2 = 2;
        }else{
            str2 = 4;
        }
        var a=1&2;
       console.log(a);
    </script>
</body>
</html>